package com.tengju.bff.infrastructure.export.repo;

import com.tengju.bff.infrastructure.export.convert.ExportWechatDealerInfoVoConvert;
import com.tengju.bff.interfaces.manage.crm.dealer.facade.WechatDealerInfoFacade;
import com.tengju.bff.interfaces.manage.crm.dealer.vo.ExportWechatDealerInfoVO;
import com.tengju.export.domain.record.ExportDataSourceRepository;
import com.tengju.export.domain.record.Query;
import com.tengju.export.domain.record.Table;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: 李大仙
 * @date: 2021/8/23 2:39 下午
 */
@Service("wechatDealerInfoExportDataSourceRepository")
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class WechatDealerInfoExportDataSourceRepository implements ExportDataSourceRepository {

    private final WechatDealerInfoFacade wechatDealerInfoFacade;

    @Override
    public Table batchFindDataSource(Query query) {
        List<ExportWechatDealerInfoVO> list = wechatDealerInfoFacade.list();
        Table table = ExportWechatDealerInfoVoConvert.convert(list);
        return table;
    }
}
